Optimal. Leaf size=50 \[ \frac {\sec (c+d x)}{a d}-\frac {\sec ^3(c+d x)}{3 a d}+\frac {\tan ^3(c+d x)}{3 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2785, 2687, 30,
2686} \begin {gather*} \frac {\tan ^3(c+d x)}{3 a d}-\frac {\sec ^3(c+d x)}{3 a d}+\frac {\sec (c+d x)}{a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2686
Rule 2687
Rule 2785
Rubi steps
\begin {align*} \int \frac {\tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx &=\frac {\int \sec ^2(c+d x) \tan ^2(c+d x) \, dx}{a}-\frac {\int \sec (c+d x) \tan ^3(c+d x) \, dx}{a}\\ &=\frac {\text {Subst}\left (\int x^2 \, dx,x,\tan (c+d x)\right )}{a d}-\frac {\text {Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\sec (c+d x)\right )}{a d}\\ &=\frac {\sec (c+d x)}{a d}-\frac {\sec ^3(c+d x)}{3 a d}+\frac {\tan ^3(c+d x)}{3 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(106\) vs. \(2(50)=100\).
time = 0.11, size = 106, normalized size = 2.12 \begin {gather*} \frac {6-10 \cos (c+d x)+2 \cos (2 (c+d x))+8 \sin (c+d x)-5 \sin (2 (c+d x))}{12 a d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) (1+\sin (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 70, normalized size = 1.40
method | result | size |
derivativedivides | \(\frac {-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {2}{3 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {8}{16 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+16}}{d a}\) | \(70\) |
default | \(\frac {-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {2}{3 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {8}{16 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+16}}{d a}\) | \(70\) |
risch | \(\frac {2 i {\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{3 i \left (d x +c \right )}+\frac {2 i}{3}-\frac {2 \,{\mathrm e}^{i \left (d x +c \right )}}{3}}{\left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{3} d a}\) | \(74\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.31, size = 90, normalized size = 1.80 \begin {gather*} \frac {4 \, {\left (\frac {2 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}}{3 \, {\left (a + \frac {2 \, a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {2 \, a \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 47, normalized size = 0.94 \begin {gather*} \frac {\cos \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1}{3 \, {\left (a d \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a d \cos \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\tan ^{2}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 5.99, size = 68, normalized size = 1.36 \begin {gather*} -\frac {\frac {3}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}} - \frac {3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.40, size = 47, normalized size = 0.94 \begin {gather*} -\frac {4\,\left (2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}{3\,a\,d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,{\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________